//
//  SJHomeCell.m
//  YYPHSpeedJump
//
//  Created by sujiang on 16/3/2.
//  Copyright © 2016年 sujiang. All rights reserved.
//

#import "SJHomeCell.h"

@interface SJHomeCell ()


@end

@implementation SJHomeCell

- (void)awakeFromNib {
    self.mengbgView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"mengbg"]];
    self.goodImageView.layer.cornerRadius = 5;
    self.goodImageView.layer.masksToBounds = YES;
//    self.bottomView.frame = CGRectMake(0, self.goodImageView.bottom + 2, self.contentView.width, self.bottom -  self.goodImageView.bottom );
//    self.lable.frame = CGRectMake((self.bottomView.width - 90) / 2, 5, 16, 14);
//    self.numJump.frame = CGRectMake(self.lable.right, 4, 74, 16);
}

- (void)setModel:(SJHomeModel *)model
{
    _model = model;
    if (model.status.integerValue != 1) {
        self.mengbgView.hidden = YES;
        self.numJump.number = model.current_price;
    } else {
        self.mengbgView.hidden = NO;
        self.numJump.number = model.original_price;
        
    }
    NSString *hour = [NSString stringWithFormat:@"%.2ld", model.remain_time / 60 / 60];
    NSString *min = [NSString stringWithFormat:@"%.2ld", (model.remain_time % 3600) / 60];
    NSString *sec = [NSString stringWithFormat:@"%.2ld", model.remain_time % 60];
    self.timeLb.text = [NSString stringWithFormat:@"%@:%@:%@", hour, min, sec];
}






@end
